import {createRouter, createWebHistory} from 'vue-router'
import layout from '/@/layout/index.vue'

const prefix = '/hpc-ui'

const router = createRouter({
    history: createWebHistory(prefix),
    routes: [
        {
            path: '/',
            name: 'pc-ui',
            component: layout,
            redirect: '/icon',
            meta: {title: 'PC UI'},
            children: [
                {
                    path: '/icon',
                    component: () => import('/@/views/document/icon/index.vue'),
                    name: 'icon',
                    meta: {title: '图标'},
                },
                {
                    path: '/button',
                    component: () => import('/@/views/document/button/index.vue'),
                    name: 'button',
                    meta: {title: '按钮'},
                },
                {
                    path: '/tab',
                    component: () => import('/@/views/document/tab/index.vue'),
                    name: 'tab',
                    meta: {title: '标签'},
                },
                {
                    path: '/tree',
                    component: () => import('/@/views/document/tree/index.vue'),
                    name: 'tree',
                    meta: {title: '树形控件'},
                },
                {
                    path: '/list',
                    component: () => import('/@/views/document/list/index.vue'),
                    name: 'list',
                    meta: {title: '列表'},
                },
                {
                    path: '/table',
                    component: () => import('/@/views/document/table/index.vue'),
                    name: 'table',
                    meta: {title: '表格'},
                },
                {
                    path: '/collapse',
                    component: () => import('/@/views/document/collapse/index.vue'),
                    name: 'collapse',
                    meta: {title: '折叠面板'},
                },
            ],
        }
    ],
})

export default router
